package com.jokins.admin.vue.user.controller;


import com.jokins.admin.vue.user.param.SysUserInfoParam;
import com.jokins.admin.vue.user.vo.SysUserVo;
import com.jokins.common.util.ResultData;
import com.jokins.admin.vue.user.service.SysUserService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 〈〉<br>
 *
 * @author Mr.Wang
 * @create 2024/9/4
 */
@RestController
@RequestMapping("/sysUser")
public class SysUserController {

    @Autowired
    SysUserService sysUserService;

    @GetMapping("/getSysUserList")
    public ResultData getSysUserInfo(SysUserInfoParam param) {
        final Page<Object> page = PageHelper.startPage(param.getCurrentPage(), param.getPageSize(), true);
        List<SysUserVo> userList= sysUserService.selectUserInfo(param);
        return ResultData.pageResponse(userList, page.getTotal(), page.getPages(), page.getPageNum());
    }
}